import type { User } from "../user/type"

export type Login = {
    username: string,
    password: string, // 密码
    rememberMe: boolean, // 记住我
    captcha: Captcha, // 验证码
}

export type Captcha = {
    captchaBase64: string,
    captchaKey: string,
    captchaCode: string,
}

export type LoginResult = {
    token: Token,
}

export type Register = {
    user: User,
    captcha: Captcha
}

export type Token = {
    header: string,
    prefix: string,
    content: string,
}

export type Perm = {
    /**
     * 权限名
     */
    name: string,
    /**
     * 权限编码
     */
    code: string,
    /**
     * 权限路径
     */
    path: string,
    /**
     * 权限级别
     */
    level: number
}

export type Role = {
    /**
     * 角色名
     */
    name: string,
    /**
     * 角色编码
     */
    code: string,
}

export type UserRole = {
    /**
     * 用户ID
     */
    userId: number,
    /**
     * 角色名
     */
    roleName: string,
}

export type RolePerm = {
    /**
     * 角色名
     */
    roleName: string,
    /**
     * 权限名
     */
    permName: string,
}
